﻿#region Using Directives

    using System;

    using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Core
{
    /// <summary>
    /// Criteria class specifying the criteria allowable for a search for a Round object
    /// </summary>
    [Serializable]
    public class RoundCriteria : CriteriaBase<RoundCriteria>
    {

        #region Constructors

            /// <summary>
            /// Default constructor for this class
            /// </summary>
            /// <param name="roundGuid">The Guid of the Round to associate with this criteria</param>                     
            public RoundCriteria(Guid roundGuid)
            {
                RoundGUID = roundGuid;                
            }

            /// <summary>
            /// Overloaded constructor for this class that accepts extra parameters 
            /// </summary>
            /// <param name="roundGuid">The Guid of the Round to associate with this criteria</param>    
            /// <param name="componentGuid">The Guid of the Component to associate with this criteria</param>     
            public RoundCriteria(Guid? roundGuid, Guid? componentGuid)
            {
                RoundGUID = roundGuid.Value;
                ComponentGUID = componentGuid.Value;
            }

        #endregion

        #region Properties

            /// <summary>
            /// This Guid is used to identify the Round object associated with this criteria
            /// </summary>
            public static PropertyInfo<Guid> RoundGUIDProperty = RegisterProperty<Guid>(p => p.RoundGUID);
            /// <summary>
            /// This Guid is used to identify the Round object associated with this criteria
            /// </summary>
            public Guid RoundGUID
            {
                get { return ReadProperty(RoundGUIDProperty); }
                private set { LoadProperty(RoundGUIDProperty, value); }
            }

            /// <summary>
            /// This Guid is used to identify the Component object associated with this criteria
            /// </summary>
            public static PropertyInfo<Guid> ComponentGUIDProperty = RegisterProperty<Guid>(p => p.ComponentGUID);
            /// <summary>
            /// This Guid is used to identify the Component object associated with this criteria
            /// </summary>
            public Guid ComponentGUID
            {
                get { return ReadProperty(ComponentGUIDProperty); }
                private set { LoadProperty(ComponentGUIDProperty, value); }
            }

        #endregion

    }
}
